import App from './App'
import uView from '@/uni_modules/uview-ui'
import Tabbar from '@/components/Tabbar/Tabbar.vue'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'

// 选择性注册高频组件（如按钮、图标）
Vue.use(uView, {
  components: ['u-button', 'u-icon', 'u-input', 'u-popup', 'u-tag', 'u-line-progress', 'u-number-box', 'u-search', 'u-rate', 'u-tabs', 'u-form', 'u-gap']
});

// 全局变量
Vue.mixin({
  data() {
    return {
      themeColor: '#F17700',
      defaultAvatar: 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0',
      defaultSignature: '这个人很懒，什么都还没写呢~'
    }
  }
})

Vue.component('Tabbar', Tabbar)

const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif